<?php
/*
 * @Author: your name
 * @Date: 2019-12-25 14:36:16
 * @LastEditTime: 2020-11-26 17:26:00
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /ahsmp_3/application/adminapiv3/controller/IpsConfig.php
 */
namespace app\adminapiv3\controller;

//ips功能能设置

class IpsConfig extends Base
{
    /**
     * @name 修改设置
     * @param $host_id
     * @author wx
     * @date 2019/11/21 14:45
     */
    public function modify($host_id)
    {
        //接收参数
        $data['status'] = $this->filterInput('status*');//状态
        $data['type'] = $this->filterInput('type');//类型
        $data['protect_ip'] = $this->filterInput('protect_ip');//保护ip
        $data['device_ip'] = $this->filterInput('device_ip');//ip
        $data['black'] = $this->filterInput('black');//黑名单
        $data['firewall'] = $this->filterInput('firewall');//防火墙

        $server = new \app\adminapiv3\service\IpsConfig();
        $server->toDo('modify', [$host_id, $data]);

        $this->jsonOutPut([], true);

        $this->Async('Wipf', 'Config');
        $this->Async('Wipf', 'WipfRules');
    }

    /**
     * @name 查询数据
     * @param $host_id
     * @author wx
     * @date 2019/12/25 10:45
     */
    public function findData($host_id)
    {
        $server = new \app\adminapiv3\service\IpsConfig();
        $info = $server->toDo('findData', [$host_id]);

        $this->jsonOutPut($info);
    }
}